﻿using FluentValidation;

namespace DDD.Application.Queries.UserQuery.GetUserPage;

public class GetUserPageQueryValidate : AbstractValidator<GetUserPageQuery>
{
    public GetUserPageQueryValidate()
    {
        RuleFor(c => c.PageIndex)
            .GreaterThanOrEqualTo(1)
            .WithMessage($"页码必须大于1");

        RuleFor(c => c.PageSize)
            .GreaterThan(0)
            .WithMessage("每页必须大于0");
    }
}
